/**
 *
 */
package de.cbf.cam.dice.entities;

import java.util.ArrayList;
import java.util.List;

import de.cbf.cam.dice.interfaces.IDiceCompositeActionListener;




/**
 * @author Nebelritter
 *
 */
public abstract class RollDefinitionListened extends RollDefinition {


	private List<ListenerEntry> listenersComposite ;


	public RollDefinitionListened() {
		super();
		listenersComposite = new ArrayList<ListenerEntry>();
	}

	/**
	 * @param listener
	 * @param event
	 * @param targetCompositeDiceName : can be same composite for effect listeners
	 */
	public void addListenerForComposite(IDiceCompositeActionListener listener,int event,String targetCompositeDiceName){
		ListenerEntry entry = new ListenerEntry();
		entry.listener 			= listener;
		entry.event				= event;
		entry.compositeDiceName = targetCompositeDiceName;
		//
		listenersComposite.add(entry);
	}

	/**
	 * @return the listenersComposite
	 */
	public List<ListenerEntry> getListenersForOtherComposites() {
		return listenersComposite;
	}

	/**
	 * @author  Surfer
	 */
	public class ListenerEntry{
		public IDiceCompositeActionListener listener;
		public int event;
		public String compositeDiceName;
	}



}
